﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace motion
{
    public partial class EnterServoDetailsForm : Form
    {
        public int m_VerticalServoNum;
        public int m_HorizontalServoNum;

        public EnterServoDetailsForm()
        {
            InitializeComponent();
        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (txtHorziontalServoName.Text == string.Empty ||
                txtVerticalServoName.Text == string.Empty ||
                !int.TryParse(txtHorizontalServoNum.Text, out m_HorizontalServoNum) ||
                !int.TryParse(txtVerticalServoNum.Text, out m_VerticalServoNum))
            {
                MessageBox.Show("כל השדות חייבים להיות מלאים. שדות מספרי הסרבו צריכים להכיל מספרים.");
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
